<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="com.google.appengine.api.users.User"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@page import="javax.jdo.PersistenceManager"%>
<%@page import="java.util.List"%>
<%@page import="com.google.appengine.api.datastore.Text"%>
<%@page import="com.appengine.news.utils.PMF"%>
<%@page import="com.appengine.news.entity.RssFeedEntity"%>
<%@page import="com.appengine.news.Constants"%>
<%@page import="com.appengine.news.ui.controller.ManageController"%>
<%@page import="com.appengine.news.ui.model.ManageModel"%>
<html>
	<body>
		<h1>List of RSSs</h1>
		<%
			final ManageController controller = new ManageController(request);
			controller.doJob();
			final List<ManageModel> models = controller.getModel();
			for (ManageModel model : models) {
		%>
		<ul>
			<li>
			<b> 
				<%=model.getTitle()%><br/>
				<b>Last Update Data: <%=model.getLastUpdate()%></b>
				<form action="/managerss" method="post">
					<input type="hidden"
						name="<%=Constants.COMMAND%>" value="<%=Constants.REMOVE_COMMAND%>" />
					<input type="hidden" name="<%=Constants.VALUE_ID%>"
						value="<%=model.getId()%>" /> <input type="submit" value="Remove" />
				</form>
			</b>
			</li>
		</ul>
		<%
			}
		%>
		<h1>Add RSS</h1>
		<form action="/managerss" method="post">
			<div>
				<input type="hidden" name="<%=Constants.COMMAND%>"
					value="<%=Constants.ADD_COMMAND%>" /> 
					<input name="<%=Constants.VALUE_URL%>"/>				
					<select name="<%=Constants.VALUE_FREQ%>">
					<option value="<%=Constants.F_UPDATE_10_MIN%>">10 minutes</option>
					<option value="<%=Constants.F_UPDATE_HALF_HOUR%>">1/2 hour</option>
					<option value="<%=Constants.F_UPDATE_HOUR%>">hour</option>
				</select> 
				<input type="submit" value="Add RSS" />
			</div>
		</form>
	</body>
</html>
